<body>
<div class="path fn-clear"><span class="fn-fb">首页</span><a href="###">内容管理</a>{$path}</div>
<div class="button-nav">
<a href="###" class="button button-blank tipa">所有栏目<i class="iconfont select-down">&#xF03C;</i></a>
<a href="{url('article/add',array(id=>$fid))}" class="button button-blank button-link"><i class="iconfont" title="增加内容">&#xF023;</i> 增加内容</a><span id="checkall" class="button button-blank button-link"><i class="iconfont">&#xF029;</i> 全选</span><span id="checktog" class="button button-blank button-link"><i class="iconfont">&#xF04D;</i> 反选</span><span id="checkoff" class="button button-blank button-link"><i class="iconfont">&#xF028;</i> 取消</span><span onclick="myform.submit()" class="button button-blank"><i class="iconfont">&#xF011;</i> 删除</span>
</div>
<div class="select-box"><div class="select-list select-a">
    <ul id="mytreechannel">{model('channel')->ClassTree($fid)}</ul>
</div></div>
<div class="m5">
<form id="myform" action="{url('article/lists')}" method="post">
<input type="hidden" name="act" value="alldel" />
<table class="table table-bordered table-striped" width="100%">
<thead><tr><th class="w10 fn-tac"><input id="all" type="checkbox" name="all" value="all" /></th><th class="w30 fn-tac">ID</th><th class="fn-tal">内容标题</th><th class="w40 fn-tac">浏览</th><th class="w40 fn-tac">状态</th><th class="w120 fn-tac">更新时间</th><th class="w120 fn-tac">操作</th></tr></thead>
<tbody>
{loop $list $vo}
<tr>
    <td class="fn-tac"><input cssrain="one" type="checkbox" name="fid[]" value="{$vo['cid']}_{$vo['id']}" /></td>
    <td class="fn-tac">{$vo['id']}</td>
    <td class="ext">
    [ <span class="fn-fb">{model('channel')->ChannelName($vo['cid'])}</span> ] <i class="iconfont">&#xF038;</i> <a title="{$vo['title']}" href="{url('article/edit',array(cid=>$vo['cid'],id=>$vo['id']))}">{if $vo['fontcolor']}<span style="color:{$vo['fontcolor']}">{/if}{$vo['title']}{if $vo['fontcolor']}</span>{/if}</a>{model('article')->extsListsCount($vo['title'],$vo['cid'],$vo['id'])}
    </td>
    <td class="fn-tac">{$vo['views']}</td>
    <td class="fn-tac">
{if $vo['sort']}<span class="pt goto blue sort_{$vo['id']}" uid="{url('article/state',array('cid'=>$vo['cid']))}" fid="{$vo['id']}" type="sort" state="1" title="取消排序">序</span>{else}<span class="pt goto gray sort_{$vo['id']}" uid="{url('article/state',array('cid'=>$vo['cid']))}" fid="{$vo['id']}" type="sort" state="0" title="排序">序</span>
{/if}
{if $vo['status']}<span class="pt goto blue stat_{$vo['id']}" uid="{url('article/state',array('cid'=>$vo['cid']))}" fid="{$vo['id']}" type="stat" state="1" title="取消审核">审</span>{else}<span class="pt goto gray stat_{$vo['id']}" uid="{url('article/state',array('cid'=>$vo['cid']))}" fid="{$vo['id']}" type="stat" state="0" title="审核">审</span>{/if}
    </td>
    <td class="fn-tac">{date('Y-m-d H:i:s',$vo['uptime'])}</td>
    <td class="fn-tac tip">
        <a class="blue" title="预览" href="{url('default/index/read',array(cid=>$vo['cid'],fid=>$vo['id']))}" target="_blank">预览</a>
        <a class="blue" title="编辑" href="{url('article/edit',array(cid=>$vo['cid'],id=>$vo['id']))}">编辑</a>
        <a class="del blue" title="删除" href="###" url="{url('article/lists',array(cid=>$vo['cid'],id=>$vo['id'],act=>del))}">删除</a>
    </td>
</tr>
{/loop}
</tbody>
</table>
</form>
<div id="page">{$page}</div>
</div>
<script type="text/javascript">
Do('base','Dialog','Tip','Tree',function(){
//状态操作
$(".goto").click(function(){
    var uid   = $(this).attr('uid');
    var fid   = $(this).attr('fid');
    var type  = $(this).attr('type');
    var state = $(this).attr('state');
    var __this= this;
    $.get(uid,{type:type,state:state,fid:fid},function(data){
        if(data=='ok'){
            $.dialog.tips('操作成功！', 1.5);
            if(state == 1){
              $('.'+type+'_'+fid).removeClass("blue").addClass ("gray");
              $('.'+type+'_'+fid).attr("state", "0"); 
            }else{
              $('.'+type+'_'+fid).removeClass("gray").addClass ("blue");
              $('.'+type+'_'+fid).attr("state", "1"); 
            }
        }else{
            $.dialog.tips('操作失败！', 1.5);
        }
    })
})
//全选
$("#all").click(function() {
    if (this.checked == true) {
        $("input[cssrain='one']").cpCheck("on");
    } else {
        $("input[cssrain='one']").cpCheck("off");
    }
});
$("#checkall").click(function() {$("input[cssrain='one']").cpCheck("on");});
$("#checkoff").click(function() {$("input[cssrain='one']").cpCheck("off");});
$("#checktog").click(function() {$("input[cssrain='one']").cpCheck("toggle");});
//删除
$('.del').click(function(){$(this).cpDelete();});
$(".tipa").powerFloat({target: $(".select-a")});
$("#mytreechannel").treeview({collapsed: true,animated: "medium",control:"#sidetreechannel",persist: "location"});
})
</script>
<body>